package com.zhanglu.fun.services.website.client;

import com.zhanglu.fun.services.website.bean.request.ForumPostRequest;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import com.zhanglu.fun.services.website.bean.request.ForumThreadRequest;
import com.zhanglu.fun.services.website.common.ResultResponse;

/**
 * @description 数据客户端
 * @author zhanglu
 * @date 2017/9/24 16:07
 */
@FeignClient("DATACENTER")
public interface DataCenterClient {
    @GetMapping("/forum/threads")
    ResultResponse getForumThreads(@RequestParam("content") String content, @RequestParam("threadGroup") String threadGroup, @RequestParam("status") String status);

    @DeleteMapping("/forum/thread")
    ResultResponse deleteForumThread(@RequestParam("id") Long id);

    @PutMapping("/forum/thread")
    ResultResponse addForumThread(@RequestBody ForumThreadRequest forumThread);

    @PostMapping("/forum/thread")
    ResultResponse updateForumThread(@RequestBody ForumThreadRequest forumThread);

    @GetMapping("forum/posts/{threadId}")
    ResultResponse getForumPostsByThreadId(@PathVariable(value = "threadId") Long threadId);

    @PutMapping("forum/post")
    ResultResponse addForumPost(ForumPostRequest post);
}
